The Tab View Component > FTabView.getItemAt()

 

FTabView.getItemAt()

Availability

Flash Player 6.

Usage

myTab_tbv.getItemAt (index)

Parameters

index A number indicating the index of the item to retrieve.

Returns

Returns an Object containing data associated with the tab at the specified index.

Description

Returns an Object containing data associated with the tab at the specified index. The object will contain the following fields.

label

A string containing the label of the tab.

linkage

An optional Object containing data associated with the tab at the specified index.

 

Notes

The name of the property that contains the name of the tab can be changed using the setLabelField method. The default value is "label".

Example

The tab_addListener.fla example file contains an example of using this method.

The following code adds three tabs to the component, and then retrieves and item and traces a value from it associated data.

myTab_tbv.addItem("Tab 1",{name:"Mike"});
myTab_tbv.addItem("Tab 2",{name:"Cathy"});
myTab_tbv.addItem("Tab 3",{name:"Belly"});

var obj = myTab_tbv.getItemAt(2);
trace("Tab 3 Name : " + obj.name) // traces "Tab 3 Name : Belly"

See also

FTabView.addItem()

FTabView.addItemAt()

FTabView.setDataProvider()